

const Router = require('koa-router');


//-----------------------
const homeController = require('./controller/home');


const router = function (app) {

    app.logger.defaultLogger.info('------init routers------');

    // TODO:
    // 可以继续细分
    // home
    const glbRouter = new Router();
    glbRouter.get('/',homeController.index);

    // xxx
    glbRouter.get('/test',homeController.test);

    glbRouter.get('/testError',homeController.testError);

    app.use(glbRouter.routes()).use(glbRouter.allowedMethods());

    return async ctx=>{}
};

module.exports = router;
